# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Ben <ben@benmazer.net>

pkgname=gmime3
pkgver=3.0.2
pkgrel=1
pkgdesc="Glorious MIME Utility Library"
arch=(i686 x86_64)
license=(GPL)
url="http://spruce.sourceforge.net/gmime/"
depends=(glib2 gpgme zlib)
makedepends=(gobject-introspection gtk-doc git vala docbook-utils)
_commit=36649c37b163adc75a7229f799afd186edebe9bd  # master
source=("git+https://git.gnome.org/browse/gmime#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd gmime
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd gmime
  git tag -f 3.0.2 36649c37b163adc75a7229f799afd186edebe9bd 
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd gmime

  ./configure --prefix=/usr \
    --program-prefix=$pkgname \
    --enable-gtk-doc \
    --enable-smime \
    --disable-static

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd gmime
  make DESTDIR="$pkgdir" install
}
